<?php

// need to iterate thru $_REQUEST

$rawtweet = "";

array_walk($_REQUEST, 'build_raw');
function build_raw($itemvalue, $key)
{
	global $rawtweet;

	if (substr($key, 0, 6) == "select")
	{
		$itemfinal = substr($itemvalue."__________", 0, 3);
		$rawtweet = $rawtweet.$itemfinal;
	}
	if (substr($key, 0, 9) == "textsmall")
	{
		$itemfinal = substr($itemvalue."__________", 0, 10);
		$rawtweet = $rawtweet.$itemfinal;
	}
	if (substr($key, 0, 7) == "textbig")
	{
		$itemfinal = substr($itemvalue."_________________________", 0, 25);
		$rawtweet = $rawtweet.$itemfinal;
	}
	if (substr($key, 0, 6) == "updown")
	{
		$itemfinal = substr($itemvalue."__________", 0, 3);
		$rawtweet = $rawtweet.$itemfinal;
	}
	if (substr($key, 0, 11) == "colorpicker")
	{
		$itemfinal = substr($itemvalue."__________", 0, 3);
		$rawtweet = $rawtweet.$itemfinal;
	}
}


$postdata = "rawtweet=".$rawtweet."&redirect=forms";

$fvsWebUrl = "http://www.boostpost.com/chirplace.com/post.php";

	$ch = curl_init();
	curl_setopt($ch, CURLOPT_POST      ,1);
	curl_setopt($ch, CURLOPT_POSTFIELDS    ,$postdata);

	curl_setopt($ch, CURLOPT_URL,$fvsWebUrl);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
	curl_setopt($ch, CURLOPT_TIMEOUT, 60);
	@session_start();
	$strCookie = 'PHPSESSID=' . $_COOKIE['PHPSESSID'] . '; path=/';

	curl_setopt($ch, CURLOPT_COOKIE, $strCookie );
	@session_write_close();
	curl_exec ($ch);
	curl_close($ch);

	header("Location: index.php?start=forms");
?> 
